<template>
  <el-card>
    <div class="page-tools">
      <div class="left">
        <!-- 如果没有给left插槽传递内容进来, 则不显示.tip这个盒子 -->
        <div v-if="$slots.left" class="tips">
          <i class="el-icon-info" />
          <!--
          <span>当前审批中 0</span>
          <span>本月审批通过 1</span>
          <span>本月审批驳回 0</span>
          -->
          <slot name="left" />
        </div>
      </div>
      <div class="reight">
        <!--
        <el-button size="small" type="warning">excel导入</el-button>
        <el-button size="small" type="danger">excel导出</el-button>
        <el-button size="small" type="primary">新增员工</el-button>
        -->
        <slot name="right" />
      </div>
    </div>
  </el-card>
</template>

<script>
export default {
  created() {
    // 接收的是一个对象, 可以通过该对象来访问被插槽分发的内容
    console.log(this.$slots)
  }
}
</script>

<style lang="scss" scoped>
   .page-tools{
       display: flex;
       justify-content: space-between;
       align-items: center;
      .tips {
        line-height: 34px;
        padding: 0px 15px;
        border-radius: 5px;
        border: 1px solid rgba(145, 213, 255, 1);
        background: rgba(230, 247, 255, 1);
        font-size: 12px;
        i {
          margin-right: 10px;
          color: #409eff;
        }
      }
   }
</style>
